// pages/credits/credits.js
var userService = require('../../services/userService.js');
var app = getApp()
Page({
  data:{
    userInfo: {}
  },
  clickReturn: function(e) {
    wx.navigateBack();
  },
  clickadd:function(e){
  },
  onLoad:function(options){
    // 页面初始化 options为页面跳转所带来的参数
    this.centerUserInfo();
  },
  onReady:function(){
    // 页面渲染完成
  },
  onShow:function(){
    // 页面显示
  },
  onHide:function(){
    // 页面隐藏
  },
  onUnload:function(){
    // 页面关闭
  },
  centerUserInfo: function () {
    var that = this;
    userService.centerUserInfo({
      user_id: app.globalData.apiUser,
      success: function (res) {
        that.setData({
          userInfo: res
        })
      }
    })
  }
})